package com.zprmb.udzt;

import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.zprmb.udzt.ll.BaseHelper;
import com.zprmb.udzt.util.Regular;
/**
 * 更多
 * @author shenshao
 *
 */
public class More extends BaseActivity implements OnClickListener{
	private ImageView img_back;
	private TextView jieshao;
	private RelativeLayout rl_back;
	private TextView tv_customer,tv_version;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.more_layout);
		 BbtApplication.getInstance().addActvity(this);
		img_back=(ImageView)findViewById(R.id.img_back);
		
		rl_back=(RelativeLayout)findViewById(R.id.rl_back);
		jieshao=(TextView)findViewById(R.id.jieshao);
		
		tv_customer=(TextView)findViewById(R.id.enterprise_tel);
		tv_version=(TextView)findViewById(R.id.tv_version);
		tv_version.setText("v"+getAppVersion());
		
		tv_customer.setOnClickListener(this);
		jieshao.setText(Regular.ToSBC("\u3000\u3000优点智投是北京紫貔财富网络科技有限公司推出的创新型互联网金融信息服务平台，总部位于北京CBD，注册资金1亿元。优点智投之名源于“成邦建堂，同沐信诚”的核心释义，寓意帮扶实体经济创建财富殿堂，共同沐浴诚信的阳光，2016年3月25日 优点智投获得互联网金融领域唯一“国字头”行业组织中国互联网金融协会的认可，以首批创始会员身份入会并正式当选为协会理事单位。"));
		rl_back.setOnClickListener(this);
		
		img_back.setOnClickListener(this);
	}
	public String getAppVersion() {
		PackageManager pm = getPackageManager();
		try {
			PackageInfo packInfo = pm.getPackageInfo(getPackageName(), 0);
			return packInfo.versionName;
		} catch (NameNotFoundException e) {
			e.printStackTrace();
			// 不可能发生.
			return "获取版本号失败";
		}
	}
	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
		BbtApplication.getInstance().removeActvity(this);
	}
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch(v.getId()){
		case R.id.img_back:
			finish();
			break;
		case R.id.rl_back:
			finish();
			break;
		
		case R.id.enterprise_tel:
			BaseHelper.showDialog2(this, "拨号", "400-0101-016", 1);
			break;
		
		}
	}

}
